<?php

class BudgetGroups extends AppModel {
  public $name = 'BudgetGroups';
  public $belongsTo = array('Budget'=>array(
      'className'=> 'Budget',
      'foreignKey'=>'budget_id',
      'type' =>'inner'
 ));
  public $hasMany = array('BudgetItems'=> array('className'=>'BudgetItems', 'foreign_key'=>'budget_group_id', 'dependent'=>true, 'order'=>'BudgetItems.item_order ASC'));
  public $validate = array(
      'Budget.name' => array(
          'name' => 'notEmpty',
          'message'=>'Group name is required'
      )
  );
   
  
}

?>
